<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>工资计算器</title>
  <style>
    body {
      font-family: Arial, sans-serif;
    }
    h2 {
      text-align: center;
    }
    label {
      display: block;
      margin-bottom: 10px;
    }
    input[type="number"] {
      width: 100%;
      padding: 10px;
      border: 1px solid #ccc;
      border-radius: 4px;
      box-sizing: border-box;
    }
    input[type="submit"] {
      background-color: #4CAF50;
      color: white;
      padding: 12px 20px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
    }
    input[type="submit"]:hover {
      background-color: #45a049;
    }
    p {
      text-align: center;
      margin-top: 20px;
    }
    #footer {
      position: fixed;
      bottom: 0;
      width: 100%;
      background-color: #f5f5f5;
      padding: 10px;
      text-align: center;
    }
    #footer p {
      margin: 0;
    }
  </style>
</head>
<body>
  <h2>工资计算器</h2>
        <input type="number" id="baseSalary" placeholder="请输入底薪（默认为2490）" value="2490">
        <input type="number" id="weekdayOvertimeHours" placeholder="请输入平时加班小时数（默认为0）" value="0">
        <input type="number" id="weekendOvertimeHours" placeholder="请输入周末加班小时数（默认为0）" value="0">
        <input type="number" id="holidayOvertimeHours" placeholder="请输入节假日加班小时数（默认为0）" value="0">
        <input type="number" id="nightShiftDays" placeholder="请输入夜班天数（默认为0）" value="0">
        <input type="number" id="otherSalary" placeholder="请输入其他工资（默认为0）" value="0">
        <button onclick="calculateSalary()">计算总工资</button>
        <p id="result"></p>
       <p>找工作，找宋先生 <a href="tel:17715292904">17715292904</a>（微信同号） 无套路</p>
    <a href="https://v.douyin.com/irFQCd5q/" target="_blank">点击进入抖音</a>
  </div>

    <script>
        const weekdayOvertimeRate = 21.4;
        const weekendOvertimeRate = 28.6;
        const holidayOvertimeRate = 42.9;
        const nightShiftSubsidyRate = 21;

        function calculateSalary() {
            const baseSalary = parseFloat(document.getElementById("baseSalary").value);
            const weekdayOvertimeHours = parseFloat(document.getElementById("weekdayOvertimeHours").value) || 0;
            const weekendOvertimeHours = parseFloat(document.getElementById("weekendOvertimeHours").value) || 0;
            const holidayOvertimeHours = parseFloat(document.getElementById("holidayOvertimeHours").value) || 0;
            const nightShiftDays = parseFloat(document.getElementById("nightShiftDays").value) || 0;
            const otherSalary = parseFloat(document.getElementById("otherSalary").value) || 0;

            const weekdayOvertimeSalary = weekdayOvertimeRate * weekdayOvertimeHours;
            const weekendOvertimeSalary = weekendOvertimeRate * weekendOvertimeHours;
            const holidayOvertimeSalary = holidayOvertimeRate * holidayOvertimeHours;
            const nightShiftSubsidy = nightShiftDays * nightShiftSubsidyRate;

            const totalSalary = baseSalary + weekdayOvertimeSalary + weekendOvertimeSalary + holidayOvertimeSalary + nightShiftSubsidy + otherSalary;

            document.getElementById("result").innerHTML = `总工资: ${totalSalary.toFixed(2)}`;
        }
    </script>
</body>
</html>